Perps collateral gating and price fixes#9530
Open
gambinish wants to merge 10 commits into
Open
Conversation
Member
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
…ns in assetCtxs handler (TAT-3387)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5dbe70c. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
Closes out three open perps-controller tickets left over from HyperLiquid's public feed changes and USDH sunset:
TAT-3454 — Price update notifications were fanning out to every subscribed symbol on every tick, even when only one symbol's price changed. Now #notifyAllPriceSubscribers takes an optional changedSymbols set so list-view subscribers (watchlists, market overview) stop re-rendering on unrelated symbol ticks.
TAT-3387 — HyperLiquid slowed down the public assetCtxs feed and introduced fastAssetCtxs to keep a fast (~5s) cadence for mark price. We now subscribe to fastAssetCtxs as the primary price source, while assetCtxs keeps handling funding/OI/volume/oracle data as before.
TAT-3304 — Following the USDH sunset, HIP-3 DEXs are now gated to USDC collateral only. Non-USDC DEXs are filtered out of market discovery and orders against them fail fast with a new UNSUPPORTED_COLLATERAL error, instead of attempting the now-defunct USDC→USDH auto-swap. The dead swap machinery and the public USDH_CONFIG export are removed (breaking).
References
Checklist
Note
Medium Risk
Touches order placement, market discovery, and all price WebSocket paths, with a breaking public export removal; behavior is well-covered by new tests but affects trading-critical flows.
Overview
After HyperLiquid’s USDH sunset, HIP-3 is USDC-collateral only: non-USDC DEXs are dropped from
getMarketsdiscovery (including allowlisted DEX names),placeOrderfails withUNSUPPORTED_COLLATERAL, and the old USDC→USDH auto-swap path is removed.USDH_CONFIGis no longer exported (breaking). Collateral checks fail open when spot metadata can’t resolve the token.fastAssetCtxsis now the primary WebSocket source for mark/mid prices (global subscription, snapshot + diffs, reconnect/clearAll lifecycle).assetCtxsstill supplies funding/OI/volume/oracle data and does not overwrite prices for coins already covered byfastAssetCtxs(HIP-3 symbols outside that feed still get prices fromassetCtxs).#notifyAllPriceSubscribersaccepts an optionalchangedSymbolsset soallMids,fastAssetCtxs, and per-symbolactiveAssetCtxticks only notify subscribers whose symbols actually moved—cutting redundant list/watchlist updates.Reviewed by Cursor Bugbot for commit ac3d3bc. Bugbot is set up for automated code reviews on this repo. Configure here.